package cn.starteasy.sample.web.common;

import cn.starteasy.core.common.service.IBaseService;
    import cn.starteasy.core.common.adminui.backend.service.IAdminUserService;
    import cn.starteasy.core.common.adminui.backend.service.IAdminUserTokenService;
    import cn.starteasy.sample.service.ICityService;
    import cn.starteasy.sample.service.ICountryService;
    import cn.starteasy.core.common.adminui.backend.service.IDataModelService;
    import cn.starteasy.core.common.adminui.backend.service.IDatagroupService;
    import cn.starteasy.core.common.adminui.backend.service.IDatagroupDataService;
    import cn.starteasy.core.common.adminui.backend.service.IModelService;
    import cn.starteasy.sample.service.IProvinceService;
    import cn.starteasy.core.common.adminui.backend.service.IResourceService;
    import cn.starteasy.core.common.adminui.backend.service.IResourceActionService;
    import cn.starteasy.core.common.adminui.backend.service.IResourceGridService;
    import cn.starteasy.core.common.adminui.backend.service.IRoleService;
    import cn.starteasy.core.common.adminui.backend.service.IRoleResourceService;
    import cn.starteasy.core.common.adminui.backend.service.IRoleUserService;
    import cn.starteasy.sample.service.IStreetService;
    import cn.starteasy.sample.service.ITownService;
    import cn.starteasy.core.common.adminui.backend.service.IUserService;
    import cn.starteasy.core.common.adminui.backend.service.IUserTokenService;
    import cn.starteasy.core.common.adminui.backend.service.IUserDatagroupService;

import cn.starteasy.core.common.ServiceManager;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.Map;

import cn.starteasy.core.common.adminui.controller.helpers.BaseServiceMaps;

@Service("sampleServiceMaps")
public class ServiceMaps extends BaseServiceMaps{
    @Autowired
    private ServiceManager serviceManager;


    @Autowired
    private IAdminUserService adminUserService;

    @Autowired
    private IAdminUserTokenService adminUserTokenService;

    @Autowired
    private ICityService cityService;

    @Autowired
    private ICountryService countryService;

    @Autowired
    private IDataModelService dataModelService;

    @Autowired
    private IDatagroupService datagroupService;

    @Autowired
    private IDatagroupDataService datagroupDataService;

    @Autowired
    private IModelService modelService;

    @Autowired
    private IProvinceService provinceService;

    @Autowired
    private IResourceService resourceService;

    @Autowired
    private IResourceActionService resourceActionService;

    @Autowired
    private IResourceGridService resourceGridService;

    @Autowired
    private IRoleService roleService;

    @Autowired
    private IRoleResourceService roleResourceService;

    @Autowired
    private IRoleUserService roleUserService;

    @Autowired
    private IStreetService streetService;

    @Autowired
    private ITownService townService;

    @Autowired
    private IUserService userService;

    @Autowired
    private IUserTokenService userTokenService;

    @Autowired
    private IUserDatagroupService userDatagroupService;

    @PostConstruct
    public void init(){
        super.init();
        serviceMap.put("adminUser",adminUserService);
        serviceMap.put("adminUserToken",adminUserTokenService);
        serviceMap.put("city",cityService);
        serviceMap.put("country",countryService);
        serviceMap.put("dataModel",dataModelService);
        serviceMap.put("datagroup",datagroupService);
        serviceMap.put("datagroupData",datagroupDataService);
        serviceMap.put("model",modelService);
        serviceMap.put("province",provinceService);
        serviceMap.put("resource",resourceService);
        serviceMap.put("resourceAction",resourceActionService);
        serviceMap.put("resourceGrid",resourceGridService);
        serviceMap.put("role",roleService);
        serviceMap.put("roleResource",roleResourceService);
        serviceMap.put("roleUser",roleUserService);
        serviceMap.put("street",streetService);
        serviceMap.put("town",townService);
        serviceMap.put("user",userService);
        serviceMap.put("userToken",userTokenService);
        serviceMap.put("userDatagroup",userDatagroupService);

        serviceManager.batchAdd(serviceMap);
    }

}
